<?php 
		$messages = MessageManager::getAllMessages();
		$msg = null;
		$messageType = null;
		$image = null;
		
		foreach( $messages as $message ) {
			if( $message->getMessageType() == Constants::MESSAGE_TYPE_INFO ) {
				$messageType = ":: Information ::";
				$image = "info";
			} else if( $message->getMessageType() == Constants::MESSAGE_TYPE_SUCCESS ) {
				$messageType = ":: Success ::";
				$image = "success";
			} else if( $message->getMessageType() == Constants::MESSAGE_TYPE_WARNING ) {
				$messageType = ":: Warning ::";
				$image = "warning";
			} else if( $message->getMessageType() == Constants::MESSAGE_TYPE_ERROR ) {
				$messageType = ":: Error ::";
				$image = "error";
			}	
			$msg = $message->getMessage();	
		}
?>
			<script>
				$(function() {
					$("#dialog").dialog({modal: true, width: 300, height: 150, resizable: false});
				});
			</script>
			<style>
				#dialog .icon {
					float: left;
					background-image: url(<?php echo Config::getApplicationContext() . "images/" . $image . ".png"; ?>);
					width: 32px;
					height: 32px;
					margin-top: 30px;
				}			
				
				#dialog .dialog-content {
					width: 230px;
					height: 90px;
					float: right;
					text-align: center;
					vertical-align: middle;
				}
			</style>
			<div id="dialog" title="<?php echo $messageType; ?>" style="display: none;">
				<div class="icon"></div>
				<div class="dialog-content">
					<table width="100%" height="100%">
						<tr><td align="center" valign="middle"><?php echo $msg; ?></td></tr>
					</table>
				</div>
			</div>


<?php /* ?>
			<script>
				$(function() {
					$( "#dialog" ).dialog();
				});
			</script>
			<div id="dialog" title="Basic dialog" style="display: none;">
				<p>
<?php  	foreach ( $messages as $message ) {					
					echo $message->getMessage();						
		} 
?>
				</p>
			</div>
<?php */ ?>